package com.shujia.exer;

/*
3. 有农民(farmer)，教师(teacher)，科学家(scientist)，
其中农民只有基本工资(basePay)， 教师除基本工资外，还有课酬(classFee_元/天)，
科学家除基本工资外，还有年终奖(yearBonus)，请你写出相关类，打印工人的全年工资（printYearSalary）。
提示：teacher，scientist 继承自farmer类
 */
public class FarmerTest {

    public static void main(String[] args) {
        Farmer farmer = new Farmer();
        farmer.basePay = 3000;
        farmer.printYearSalary();

        Teacher teacher = new Teacher();
        teacher.basePay = 4000;
        teacher.classFee = 15;
        teacher.printYearSalary();


        Scientist scientist = new Scientist();
        scientist.basePay = 4500;
        scientist.yearBonus = 90000;
        scientist.printYearSalary();
    }
}
